package cn.pinming.chyn.tools.utils;

import org.springframework.core.env.Environment;

public class PropertyUtil {

	private static Environment environment ; 
	
	public static String get(String key , String defaultValue) {
		if(environment == null) {
			environment = SpringUtil.getBean(Environment.class) ;
		}
		String value = environment.getProperty(key) ; 
		return value == null ? defaultValue : value ;
	}
	
	public static String get(String key) {
		return get(key, null) ;
	}
	
}
